<div class="content-section introduction">
    <div class="feature-intro">
        <h1>ScrollPanel</h1>
        <p>ScrollPanel is a cross browser, lightweight and themable alternative to native browser scrollbar.</p>
    </div>
    <app-demoActions github="scrollpanel" stackblitz="scrollpanel-demo"></app-demoActions>
</div>

<div class="content-section implementation">
    <div class="card">
        <div class="grid">
            <div class="col-12 md:col-4">
                <p-scrollPanel [style]="{width: '100%', height: '200px'}">
                    <p>
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                        Vitae et leo duis ut diam.
                        Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing elit ut.
                        Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna.
                        Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris.
                        Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales.
                        Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet nisl purus.
                        Cursus sit amet dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas.
                        Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris.
                        Eget egestas purus viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer.
                        Mattis aliquam faucibus purus in massa tempor nec.
                    </p>
                </p-scrollPanel>
            </div>
            <div class="col-12 md:col-4">
                <p-scrollPanel [style]="{width: '100%', height: '200px'}" styleClass="custombar1">
                    <p>
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                        Vitae et leo duis ut diam.
                        Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing elit ut.
                        Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna.
                        Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris.
                        Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales.
                        Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet nisl purus.
                        Cursus sit amet dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas.
                        Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris.
                        Eget egestas purus viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer.
                        Mattis aliquam faucibus purus in massa tempor nec.
                    </p>
                </p-scrollPanel>
            </div>
            <div class="col-12 md:col-4">
                <p-scrollPanel [style]="{width: '100%', height: '200px'}" styleClass="custombar2">
                    <p style="width: 600px">
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                        Vitae et leo duis ut diam.
                        Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing elit ut.
                        Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna.
                        Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris.
                        Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales.
                        Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet nisl purus.
                        Cursus sit amet dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas.
                        Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris.
                        Eget egestas purus viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer.
                        Mattis aliquam faucibus purus in massa tempor nec.
                    </p>
                </p-scrollPanel>
            </div>
        </div>
    </div>
</div>

<div class="content-section documentation">
    <p-tabView>
        <p-tabPanel header="Documentation">
            <h5>Import</h5>
<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;ScrollPanelModule&#125; from 'primeng/scrollpanel';
</app-code>

            <h5>Getting Started</h5>
            <p>ScrollPanel is defined with p-scrolPanel element having dimensions for the scrollable viewport.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-scrollPanel [style]="&#123;width: '100%', height: '200px'&#125;"&gt;
    Content
&lt;/p-scrollPanel&gt;
</app-code>
            <h5>Customization</h5>
            <p>Look and feel can easily be customized, here is an example with a background and blue handle.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-scrollPanel [style]="&#123;width: '100%', height: '200px'&#125;" styleClass="custom"&gt;
    Content
&lt;/p-scrollPanel&gt;
</app-code>

<app-code lang="css" ngNonBindable ngPreserveWhitespaces>
.p-scrollpanel &#123;
    p &#123;
        padding: .5rem;
        line-height: 1.5;
        margin: 0;
    &#125;

    &.custombar1 &#123;
        .p-scrollpanel-wrapper &#123;
            border-right: 9px solid var(--layer-1);
        &#125;

        .p-scrollpanel-bar &#123;
            background-color: var(--primary-color);
            opacity: 1;
            transition: background-color .2s;

            &:hover &#123;
                background-color: #007ad9;
            &#125;
        &#125;
    &#125;

    &.custombar2 &#123;
        .p-scrollpanel-wrapper &#123;
            border-right: 9px solid var(--layer-1);
            border-bottom: 9px solid var(--layer-1);
        &#125;

        .p-scrollpanel-bar &#123;
            background-color: var(--layer-2);
            border-radius: 0;
            opacity: 1;
            transition: background-color .2s;
        &#125;
    &#125;
&#125;
</app-code>

            <h5>Properties</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>style</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Inline style of the component.</td>
                        </tr>
                        <tr>
                            <td>styleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the component.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Templates</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Parameters</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>content</td>
                            <td>-</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Styling</h5>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Element</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>p-scrollpanel</td>
                            <td>Container element.</td>
                        </tr>
                        <tr>
                            <td>p-scrollpanel-wrapper</td>
                            <td>Wrapper of content section.</td>
                        </tr>
                        <tr>
                            <td>p-scrollpanel-content</td>
                            <td>Content section.</td>
                        </tr>
                        <tr>
                            <td>p-scrollpanel-bar</td>
                            <td>Scrollbar handle.</td>
                        </tr>
                        <tr>
                            <td>p-scrollpanel-bar-x</td>
                            <td>Scrollbar handle of a horizontal bar.</td>
                        </tr>
                        <tr>
                            <td>p-scrollpanel-bar-y</td>
                            <td>Scrollbar handle of a vertical bar</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Methods</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Parameters</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>refresh</td>
                            <td>-</td>
                            <td>Refreshes the position and size of the scrollbar.</td>
                        </tr>
                        <tr>
                            <td>scrollTop</td>
                            <td>value: number</td>
                            <td>Scrolls the top location to the given value.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Dependencies</h5>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
        <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/panel" class="btn-viewsource" target="_blank">
            <span>View on GitHub</span>
        </a>

        <a href="https://stackblitz.com/edit/primeng-scrollpanel-demo" class="btn-viewsource" style="margin-left: .5em;" target="_blank">
            <span>Edit in StackBlitz</span>
        </a>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;div class="grid"&gt;
    &lt;div class="col-12 md:col-4"&gt;
        &lt;p-scrollPanel [style]="&#123;width: '100%', height: '200px'&#125;"&gt;
            &lt;p&gt;
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                Vitae et leo duis ut diam.
                Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing elit ut.
                Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna.
                Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris.
                Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales.
                Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet nisl purus.
                Cursus sit amet dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas.
                Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris.
                Eget egestas purus viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer.
                Mattis aliquam faucibus purus in massa tempor nec.
            &lt;/p&gt;
        &lt;/p-scrollPanel&gt;
    &lt;/div&gt;
    &lt;div class="col-12 md:col-4"&gt;
        &lt;p-scrollPanel [style]="&#123;width: '100%', height: '200px'&#125;" styleClass="custombar1"&gt;
            &lt;p&gt;
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                Vitae et leo duis ut diam.
                Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing elit ut.
                Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna.
                Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris.
                Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales.
                Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet nisl purus.
                Cursus sit amet dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas.
                Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris.
                Eget egestas purus viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer.
                Mattis aliquam faucibus purus in massa tempor nec.
            &lt;/p&gt;
        &lt;/p-scrollPanel&gt;
    &lt;/div&gt;
    &lt;div class="col-12 md:col-4"&gt;
        &lt;p-scrollPanel [style]="&#123;width: '100%', height: '200px'&#125;" styleClass="custombar2"&gt;
            &lt;p style="width: 600px"&gt;
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                Vitae et leo duis ut diam.
                Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing elit ut.
                Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna.
                Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris.
                Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales.
                Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet nisl purus.
                Cursus sit amet dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas.
                Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris.
                Eget egestas purus viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer.
                Mattis aliquam faucibus purus in massa tempor nec.
            &lt;/p&gt;
        &lt;/p-scrollPanel&gt;
    &lt;/div&gt;
&lt;/div&gt;
</app-code>

<app-code lang="css" ngNonBindable ngPreserveWhitespaces>
.p-scrollpanel &#123;
    p &#123;
        padding: .5rem;
        line-height: 1.5;
        margin: 0;
    &#125;

    &.custombar1 &#123;
        .p-scrollpanel-wrapper &#123;
            border-right: 9px solid var(--layer-1);
        &#125;

        .p-scrollpanel-bar &#123;
            background-color: var(--primary-color);
            opacity: 1;
            transition: background-color .2s;

            &:hover &#123;
                background-color: #007ad9;
            &#125;
        &#125;
    &#125;

    &.custombar2 &#123;
        .p-scrollpanel-wrapper &#123;
            border-right: 9px solid var(--layer-1);
            border-bottom: 9px solid var(--layer-1);
        &#125;

        .p-scrollpanel-bar &#123;
            background-color: var(--layer-2);
            border-radius: 0;
            opacity: 1;
            transition: background-color .2s;
        &#125;
    &#125;
&#125;    
</app-code>
        </p-tabPanel>
        <p-tabPanel header="StackBlitz">
            <ng-template pTemplate="content">
                <iframe src="https://stackblitz.com/edit/primeng-scrollpanel-demo?embed=1" style="width: 100%; height: 768px; border: none;"></iframe>
            </ng-template>
        </p-tabPanel>
    </p-tabView>
</div>
